/**
 * Created by haowanh5 on 2016/11/2.
 */

"use strict";

const Logger = require("pomelo-logger").getLogger("TestCase", __filename);
const RQ = require("request");
const Configs = require("../Configs/MultiServer.json");

Configs.ports.forEach(function (port) {
    RQ("http://"+Configs.host+":" + (port + 1000), {}, function (err, res, body) {
        if (err || (res && res.statusCode !== 200)) {
            Logger.error("Error Happens", res, err);
        }
        Logger.info("Server [ %s ] Status: [ %j ]", port + 1000, body);
    });
});

RQ("http://"+Configs.host+":" + Configs.master.port, {}, function (err, res, body) {
    if (err || (res && res.statusCode !== 200)) {
        Logger.error("Master Server Error Happens", res, err);
    }
    Logger.info("Master Server [ %s ] Status: [ %j ]", Configs.master.port, body);
});